package com.pda.gongpin.ui.fulltrayin;

import android.widget.EditText;
import android.widget.TextView;

import com.pda.gongpin.R;
import com.pda.gongpin.bean.SkuListBean;
import com.pda.gongpin.contract.FullTrayInNewContract;
import com.pda.gongpin.presenter.FullTrayInNewPresenter;
import com.wangshen.base.ui.mvp.base.ui.BaseMvpFragment;

import org.greenrobot.eventbus.EventBus;

import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

public class FullTrayInTwoFragment extends BaseMvpFragment<FullTrayInNewPresenter> implements FullTrayInNewContract.View {
    @BindView(R.id.tv_materialCode)
    TextView tvMaterialCode;
    @BindView(R.id.tv_articleId)
    TextView tvArticleId;
    @BindView(R.id.tv_articleName)
    TextView tvArticleName;
    @BindView(R.id.tv_spec)
    TextView tvSpec;
    @BindView(R.id.tv_brand)
    TextView tvBrand;
    @BindView(R.id.tv_packageSpecFull)
    TextView tvPackageSpecFull;
    @BindView(R.id.tv_shouldEntryNumStr)
    TextView tvShouldEntryNumStr;
    @BindView(R.id.tv_alreadyEntryNumStr)
    TextView tvAlreadyEntryNumStr;
    @BindView(R.id.et_num)
    EditText etNum;
    @BindView(R.id.tv_move_out)
    TextView tvMoveOut;
    SkuListBean skuListBean;
    @BindView(R.id.tv_standard)
    TextView tvStandard;
    @BindView(R.id.tv_surfaceTreatment)
    TextView tvSurfaceTreatment;
    @BindView(R.id.tv_grade)
    TextView tvGrade;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_inNum)
    TextView tvInNum;

    public FullTrayInTwoFragment() {
    }

    public FullTrayInTwoFragment(SkuListBean skuListBean) {
        this.skuListBean = skuListBean;
    }

    @Override
    public FullTrayInNewPresenter getPresenter() {
        return new FullTrayInNewPresenter();
    }

    @Override
    public int getViewId() {
        return R.layout.fragment_full_tray_in_two;
    }

    @Override
    public void initView() {
        tvTitle.setText(skuListBean.getTitle());
        tvSpec.setText("规格：" + skuListBean.getSpec());
        tvArticleId.setText("物品编码： " + skuListBean.getArticleId());
        tvArticleName.setText("物品名称：" + skuListBean.getArticleName());
        tvAlreadyEntryNumStr.setText("已出库数量：" + skuListBean.getAlreadyEntryNumStr());
        tvBrand.setText("品牌：" + skuListBean.getBrand());
        tvPackageSpecFull.setText("包格：" + skuListBean.getPackageSpecFull());
        tvShouldEntryNumStr.setText("应入库数量：" + skuListBean.getShouldEntryNumStr());
        tvMaterialCode.setText("我的料号" + skuListBean.getMaterialCode());
        tvStandard.setText("标准："+skuListBean.getStandard());
        tvGrade.setText("等级："+skuListBean.getGrade());
        tvSurfaceTreatment.setText("表色："+skuListBean.getSurfaceTreatment());
        tvInNum.setText("上架数量（"+skuListBean.getInNum()+"）");
    }

    @Override
    public void initLinsenterner() {

    }

    @Override
    public void getData() {

    }

    @OnClick(R.id.tv_move_out)
    public void onViewClicked() {
        skuListBean.setNum(etNum.getText().toString());
        EventBus.getDefault().post(skuListBean);
    }

    @Override
    public void setList(List<SkuListBean> list) {

    }
}
